﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SGRapidForm.Foundation.Service.Interface;
using SGRapidForm.Foundation.Component;
using SGRapidForm.Foundation.Entity;
namespace SGRapidForm.Foundation.Service
{
    partial class FoundationService : IFoundationService
    {
        private AutoGennoComponet autoGennoComponet;
        public AutoGennoComponet AutoGennoComponet
        {
            get
            {
                if (autoGennoComponet == null)
                {
                    this.autoGennoComponet = new AutoGennoComponet();
                }
                return this.autoGennoComponet;
            }
            set { autoGennoComponet = value; }
        }

        /// <summary>
        /// 进行过滤、排序、分页查询自动编码记录数
        /// </summary>
        /// <param name="filterConditions">过滤条件</param>
        /// <returns>记录数</returns>
        public int PagingGetAutoGennoCount(String filterConditions)
        {
            return this.AutoGennoComponet.GetAutoGennoCount(filterConditions);
        }

        /// <summary>
        /// 进行过滤、排序、分页查询自动编码
        /// </summary>
        /// <param name="startRecord">开始记录索引</param>
        /// <param name="maxRecords">每页记录数</param>
        /// <param name="sortColumns">排序列</param>
        /// <param name="filterConditions">过滤条件SQL</param>
        /// <returns>自动编码集合</returns>
        public List<AutoGennoEntity> PagingGetAutoGenno(Int32 startRecord, Int32 maxRecords, String sortColumns, String filterConditions)
        {

            return this.AutoGennoComponet.PagingGetAutoGenno(startRecord, maxRecords, sortColumns, filterConditions);
        }

        /// <summary>
        /// 批量删除编码
        /// </summary>
        /// <param name="keyids">keyids</param>
        /// <returns>批量删除是否成功</returns>
        public bool Auto_BulkDeleteAutos(string keyids)
        {
            return this.AutoGennoComponet.BulkDeleteAuto(keyids);
        }

        /// <summary>
        /// 根据keyid查询自动编码集合
        /// </summary>
        /// <param name="keyid">keyid</param>
        /// <returns>自动编码集合</returns>
        public AutoGennoEntity Auto_GetByKeyid(string keyid)
        {
            return this.AutoGennoComponet.GetAutoGennoByKeyid(keyid);
        }

        /// <summary>
        /// 更新一条记录
        /// </summary>
        /// <param name="UserDetails">一条记录</param>
        /// <returns>是否更新成功</returns>
        public bool Auto_UpdateAuto(AutoGennoEntity autoEntity)
        {
            return this.AutoGennoComponet.UpdateAuto(autoEntity);
        }

        /// <summary>
        /// 新增一条自动编码记录数据
        /// </summary>
        /// <param name="foundationClass">一条自动编码记录的记录信息</param>
        /// <returns>是否新增成功</returns>
        public bool Auto_Add(AutoGennoEntity autoEntity)
        {
            return this.AutoGennoComponet.AddAutoGenno(autoEntity);
        }

        public string Auto_GetNoByNoClass(string classCode, string deptCode)
        {
            return this.AutoGennoComponet.GetNoByNoClass(classCode, deptCode);
        }
    }
}
